export function useMemory<T>(initialValue: T) {
  let state = initialValue; // 如果 state 变量为空，则初始化为 initialValue

  function get() {
    return state;
  }

  function set(newValue: T) {
    state = newValue;
  }

  return { get, set };
}
